<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>报废生产工单</title>

<script type="text/javascript" src="${ctx }/js/workorders.js"></script>
<script type="text/javascript" src="${ctx }/js/common.js"></script>
<script type="text/javascript" language="javascript">
	//     var selBtn = 0;
	//     var nodeId = 0;
	$(document).ready(function() {
        var datepickerconf = {
            changeMonth : true,
            changeYear : true,
            dateFormat : "yyyy/mm/dd hh:mm:ss"
        };
		$("#firstInspectionTime").datepicker(datepickerconf);
		$("#firstInspectionTime").val(getSystemData());
		$("#completeDate").datepicker(datepickerconf);
		$("#completeDate").val(getSystemData());
		$("#receivingInspectionDate").datepicker(datepickerconf);
		$("#receivingInspectionDate").val(getSystemData());
	});
</script>
</head>
<body>
	<h4>
		生产管理. <small>报废生产工单</small>
		</h4>
		<form action="workOrderAction!scrap" class="form-horizontal" role="form" method="post">
			<input type="hidden" name="workOrder.id" value="${workOrder.id}"/>
			<input type="hidden" name="workOrder.batchNum" value="${workOrder.batchNum}"/>
			<input type="hidden" name="workOrder.status" value="${workOrder.status}"/>
			<input type="hidden" name="workOrder.partCode" value="${workOrder.partCode}"/>
			<div class="form-group">
		    	<label class="col-sm-2 control-label">批次号</label>
		        <div class="col-sm-10">
		        	<p class="form-control-static">${workOrder.batchNum}</p>
		      	</div>
		    </div>
			<div class="form-group">
				<label class="col-sm-2 control-label">零件类型</label> 
				<div class="col-sm-10">
				<select id="partType"
					class="form-control" name="partType">
					<option value=0>全部</option>
					<option value=1>外购</option>
					<option value=2>自制</option>
					<option value=3>组焊</option>
					<option value=4>组合</option>
					<option value=6>总成</option>
					<option value=5>整机</option>
				</select>
				</div>
			</div>
			<div class="form-group">
		    	<label class="col-sm-2 control-label">零件图号</label>
		        <div class="col-sm-10">
		        	<p class="form-control-static">${workOrder.partCode}</p>
		      	</div>
		    </div>
			<div class="form-group">
		    	<label class="col-sm-2 control-label">零件名称</label>
		        <div class="col-sm-10">
		        	<p class="form-control-static">${workOrder.partName}</p>
		      	</div>
		    </div>
			<div class="form-group">
		    	<label for="lastname" class="col-sm-2 control-label">姓名</label>
		        <div class="col-sm-10">
                    <p class="form-control-static">
                        <c:choose>
                            <c:when test="${'NEW'==workOrder.status}">
            		        	<input type="text" class="form-control" name="workOrder.workerName" id="workerName" value="${workOrder.workerName}" placeholder="请输入姓名">
                            </c:when>
                            <c:otherwise>
                                ${workOrder.workerName}
                            </c:otherwise>
                        </c:choose>
		      	</div>
		    </div>
            <div class="form-group">
                <label for="lastname" class="col-sm-2 control-label">工序</label>
                <div class="col-sm-10">
                    <p class="form-control-static">${workOrder.procedure.wpName}</p>
                </div>
            </div>
			<div class="form-group">
		    	<label for="lastname" class="col-sm-2 control-label">单件工时</label>
		        <div class="col-sm-10">
		        	<input type="text" class="form-control" name="workOrder.manHours" value="${workOrder.manHours }" id="manHours" placeholder="请输入单件工时">
		      	</div>
		    </div>
			<div class="form-group">
		    	<label class="col-sm-2 control-label">报废数量</label>
		        <div class="col-sm-10">
		        	<p class="form-control-static">1</p>
		      	</div>
		    </div>
			<div class="form-group">
		    	<label class="col-sm-2 control-label">工作单状态</label>
		        <div class="col-sm-10">
		        	<p class="form-control-static">
                        <c:choose>
                            <c:when test="${'NEW'==workOrder.status}">
                                     新工作单
                            </c:when>
                            <c:when test="${'ASSIGNED'==workOrder.status}">
                            	已分配
                            </c:when> 
                            <c:when test="${'FCHECK'==workOrder.status}">
                            	已完成首检
                            </c:when> 
                            <c:when test="${'INSPECTED'==workOrder.status}">
                            	已完成检验
                            </c:when>
                        </c:choose>
                    </p>
		      	</div>
		    </div>
   		    	 <%-- 
   		    	 <div class="form-group">
                       <label class="col-sm-2 control-label">首检员</label>
                       <div class="col-sm-10">
					    <c:choose>
					    	<c:when test="${'ASSIGNED'==workOrder.status}">
                           		<input type="text" class="form-control" name="workOrder.firstInspectionName" id="firstInspectionName" placeholder="请输入首检员">
					    	</c:when>
					    	<c:when test="${'FCHECK'==workOrder.status}">
					    		<p class="form-control-static">${workOrder.firstInspectionName }</p>
					    	</c:when>
					    </c:choose>
                       </div>
                   </div>
                   <div class="form-group">
                       <label class="col-sm-2 control-label">首检时间</label>
                       <div class="col-sm-10">
                       <c:choose>
					    	<c:when test="${'ASSIGNED'==workOrder.status}">
	                            <input type="text" class="form-control" name="workOrder.firstInspectionTime" id="firstInspectionTime" placeholder="请输入首检时间">
					    	</c:when>
					    	<c:when test="${'FCHECK'==workOrder.status}">
					    		<p class="form-control-static">${workOrder.firstInspectionTime }</p>
					    	</c:when>
					    </c:choose>
                       </div>
                   </div> --%>
		    <c:choose>
		    	<c:when test="${'FCHECK'==workOrder.status}">
        			<div class="form-group">
        		    	<label class="col-sm-2 control-label">合格数量</label>
        		        <div class="col-sm-10">
        		        	<input type="text" class="form-control" name="workOrder.qualifiedQuantity" id="qualifiedQuantity" placeholder="请输入合格数量" value="${workOrder.qualifiedQuantity }">
        		      	</div>
        		    </div>
        			<div class="form-group">
        		    	<label class="col-sm-2 control-label">完工时间</label>
        		        <div class="col-sm-10">
        		        	<input type="text" class="form-control" name="workorder.completeDate" value="${workOrder.completeDate }" id="completeDate" placeholder="请选择首检时间">
        		      	</div>
        		    </div>
        			<div class="form-group">
        		    	<label class="col-sm-2 control-label">收检人</label>
        		        <div class="col-sm-10">
        		        	<input type="text" class="form-control" name="workOrder.receivingInspection" value="${workOrder.receivingInspection }" id="receivingInspection" placeholder="请选择收检人">
        		      	</div>
        		    </div>
        			<div class="form-group">
        		    	<label class="col-sm-2 control-label">收检时间</label>
        		        <div class="col-sm-10">
        		        	<input type="text" class="form-control" name="workOrder.receivingInspectionDate" value="${workOrder.receivingInspectionDate }" id="receivingInspectionDate" placeholder="请选择收检时间">
        		      	</div>
        		    </div>
        			<div class="form-group">
        		    	<label class="col-sm-2 control-label">检验员</label>
        		        <div class="col-sm-10">
        		        	<input type="text" class="form-control" name="workOrder.qualityInspector" value="${workOrder.qualityInspector }" id="qualityInspector" placeholder="请选择检验员">
        		      	</div>
        		    </div>
                </c:when>
		    	<c:when test="${'INSPECTED'==workOrder.status}">
                
                </c:when>
                <c:otherwise>
                </c:otherwise>
		    </c:choose>
       			<div class="form-group">
       		    	<label class="col-sm-2 control-label">车间主任</label>
       		        <div class="col-sm-10">
       		        	<p class="form-control-static">${workOrder.workshopLeader }</p>
       		        	<!--  <input type="text" class="form-control" name="workOrder.workshopLeader" value="${workOrder.workshopLeader }" id="workshopLeader" placeholder="请选择车间主任">-->
       		      	</div>
       		    </div>
			<div class="form-group">
		      <div class="col-sm-offset-2 col-sm-10">
		         <button type="submit" class="btn btn-default">报废</button>
		         <button type="button" class="btn btn-default" onClick="javascript :history.back(-1);">取消</button>
		      </div>
		   </div>
		</form>
</body>
</html>